package com.hyt.it.ogt.controller.ykcj.common;

import javax.annotation.Resource;

import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import com.hyt.common.apiInfor.ApiResponse;
import com.hyt.it.ogt.controller.base.BaseController;
import com.hyt.it.ogt.ykcj.domain.vo.PostSignatureResponseVO;
import com.hyt.it.ogt.ykcj.service.config.IConfigService;
import com.obs.services.model.PostSignatureResponse;

import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiOperationSort;
import io.swagger.annotations.ApiSort;
import lombok.extern.slf4j.Slf4j;

/**
 * <p>
 * 字典接口控制器
 * </p>
 *
 * @author huangwu
 * @since 2022-02-16
 */
@RestController
@Api(tags = "config.1.配置信息接口", value = "配置信息接口")
@ApiSort(value = 1)
@RequestMapping("/config")
@Slf4j
public class ThirdPartyConfigController extends BaseController {

    @Resource
    IConfigService configService;

    @ApiOperation(value = "21.1.1 获取华为云bucket临时凭证", response = PostSignatureResponse.class)
    @ApiOperationSort(1)
    @RequestMapping(value = "/getBucketTempCredential", method = RequestMethod.GET)
    public ApiResponse<PostSignatureResponseVO> getBucketTempCredential() {
        return ApiResponse.<PostSignatureResponseVO>builder()
                .code(20000)
                .data(configService.getFileUploadConfig())
                .build();
    }
}
